<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>js_dom练习04</title>
		<script type="text/javascript">
			//改变id为card的高度
			function changeHeight(){
				var card = document.getElementById("card");
				var oldH = card.style.height;
				card.style.height=(parseInt(oldH)+10)+"px";
			}
			//改变表单背景色
			function changeBGC(){
				var myform = document.getElementById("myform");
				myform.style.backgroundColor="red";
			}
			var box = ['tom', 28, 'NewYork'];
//			delete box[1];						//给数组前端添加一个元素，并且返回最新的长度
			alert(box[1]);
			alert(box.length);
			box.splice(1,0,'a','c');
			alert(box);
		</script>
	</head>
	<body>
		<form id="myform" method="post" style="background-color: aqua;" >
			卡号：<input type="text" name="card" id="card" style="height: 50px;"/>
			<input type="button" name="changeH" id="changeH" value="改变高度"  onclick="changeHeight()"/><br />
			密码：<input type="password" id="pw" />
			<input type="button" name="changeC" id="changeC" value="改变背景色" onclick="changeBGC();changeHeight()"/>
		</form>
	</body>
</html>
